<template>
	<view>
		<view class="rule-box">
			<image class="rule-img" mode="widthFix" @click="showAgreement(2)"
				src="https://web.78keji.cn/images/pz/mfguize.png">
			</image>
			<image class="rule-img" mode="widthFix" @click="telMobile" src="https://web.78keji.cn/images/pz/mfkefu.png">
			</image>
			<image class="rule-img" mode="widthFix" @click="gotoQuanyi"
				src="https://web.78keji.cn/images/pz/mfquanyi.png"></image>
		</view>
		<view v-if="isShowRule" class="rule-content-box">
			<image @click="isShowRule = false" class="rule-img" mode="widthFix" :src="baseImagePath + 'rule.png'">
			</image>
		</view>
	</view>
</template>

<script>
		import zfbUrlUtil from '../../utils/zfbUrlUtil';
	export default {
		data() {
			return {
				isShowRule: false,
			};
		},
		props: ['baseImagePath'],
		methods: {
			telMobile() {
				uni.makePhoneCall({
					phoneNumber: '4008825101'
				})
			},
			gotoQuanyi() {
if(uni.getStorageSync('mobile')){
	let url = 'https:h5.2018sx.cn/pzb/lingqu/?mobile=' + uni.getStorageSync('mobile')
	let link = zfbUrlUtil.wrapUrl(url)
	
	my.ap.openURL({
		url: link, // 请将 url 替换为有效的页面地址
		success: (res) => {
			console.log('openURL success', res)
		},
		fail: (err) => {
			console.log('openURL success', err)
		}
	});
}else{
	uni.showToast({
		title: '请先点击并办理权益',
		icon: 'none', //将值设置为 success 或者 ''
		duration: 2000 //持续时间为 2秒
	})
}
			
			},
			showAgreement(value) {
				this.$emit('showAgreement', value)
			}
		}
	}
</script>

<style lang="scss">
	.rule-box {
		position: fixed;
		top: 200rpx;
		right: 0;

		.rule-img {
			width: 52rpx;
			height: auto;
			margin-bottom: 20rpx;
			display: block;
		}
	}


	.rule-content-box {
		position: fixed;
		width: 100%;
		height: 100vh;
		left: 0;
		top: 0;
		overflow: auto;
		z-index: 9;

		.rule-img {
			width: 100%;
			height: auto;
		}
	}
</style>